package com.shuiyun.jtt.message.jt808.extend;

import com.shuiyun.jtt.utils.codec.DataType;
import com.shuiyun.jtt.utils.codec.FieldValue;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 矩形区域
 */
@Data
public class RectangleArea {

    @FieldValue(type = DataType.DWORD,desc = "区域ID")
    @ApiModelProperty(value = "区域ID",example = "1")
    private Integer areaId;

    @FieldValue(type = DataType.WORD,desc = "属性")
    @ApiModelProperty(value = "属性",example = "3",notes = "" +
            "bit0-是否启用开始结束时间判断规则 " +
            "bit1-是否启用最高速度、超速持续时间和夜间最高速度判断规则" +
            "bit2-进入区域是否报警给驾驶员" +
            "bit3-进入区域是否报警给平台" +
            "bit4-离开区域是否报警给驾驶员" +
            "bit5-离开区域是否报警给平台" +
            "bit6-0:北纬 1：南纬" +
            "bit7-0:东经 1：西经" +
            "bit8-0：允许开门 1：禁止开门" +
            "bit14-0:进区域开启通信模块 1：进区域关闭通信模块" +
            "bit15-0:进区域不采集GNSS详细定位数据 1：进区域采集详细定位数据")
    private Integer attribute;

    @FieldValue(type = DataType.DWORD,desc = "左上点纬度")
    @ApiModelProperty(value = "左上点纬度",example = "39918985")
    private Integer upperLeftLatitude;

    @FieldValue(type = DataType.DWORD,desc = "左上点经度")
    @ApiModelProperty(value = "左上点经度",example = "116392214")
    private Integer upperLeftLongitude;


    @FieldValue(type = DataType.DWORD,desc = "右下点纬度")
    @ApiModelProperty(value = "右下点纬度",example = "39911901")
    private Integer lowerRightLatitude;

    @FieldValue(type = DataType.DWORD,desc = "右下点经度")
    @ApiModelProperty(value = "右下点经度",example = "116414781")
    private Integer lowerRightLongitude;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "开始时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    @ApiModelProperty(value = "开始时间(yyMMddHHmmss)",example = "220202144010")
    private String startTime;

    @FieldValue(type = DataType.BCD8421,length = 6,desc = "结束时间(yyMMddHHmmss)",checkMethod = {"attribute","&!","1"})
    @ApiModelProperty(value = "结束时间(yyMMddHHmmss)",example = "220202144020")
    private String endTime;

    @FieldValue(type = DataType.WORD,desc = "最高速度(km/h)",checkMethod = {"attribute","&!","2"})
    @ApiModelProperty(value = "最高速度(km/h)",example = "100")
    private Integer maxSpeed;

    @FieldValue(type = DataType.BYTE,desc = "超速持续时间(s)",checkMethod = {"attribute","&!","2"})
    @ApiModelProperty(value = "超速持续时间(s)",example = "120")
    private Integer duration;

    @FieldValue(type = DataType.WORD,desc = "夜间限速(km/h)",checkMethod = {"attribute","&!","2"})
    @ApiModelProperty(value = "夜间限速(km/h)",example = "100")
    private Integer nightSpeed;

    @FieldValue(type = DataType.STRING,lengthSize = 2,desc = "区域名称")
    @ApiModelProperty(value = "区域名称",example = "矩形区域名称")
    private String name;

}
